<template>
  <div></div>
</template>

<script>

export default {
  name: 'Laucher',
  data() {
    return {
      countDown: 5,
      timer: null,
    }
  },
  mounted() {
    const url = new URL(window.location.href)
    if(url.searchParams.get('token') == null){
      var redirect = url.origin + url.pathname
      this.$store.state.redirect = redirect
      sessionStorage.setItem('redirect', redirect)
    }
    this.$store.state.XAccessToken = url.searchParams.get('token')
    sessionStorage.setItem('XAccessToken', this.$store.state.XAccessToken)
    this.$store.state.tenantId = url.searchParams.get('tenantId')
    sessionStorage.setItem('tenantId', this.$store.state.tenantId)
    if(this.$store.state.XAccessToken == '' || this.$store.state.XAccessToken == null){
      console.log("token为空")
      location.assign('http://dev.i3vsoft.com:10100/saas-dev/enterprise/#/login?redirect='+encodeURIComponent(sessionStorage.getItem('redirect'))+'&title=百思商城商家后台&productId=1772514752703082498')
    }else{
      this.$router.replace('/Main')
    }
  }

}

</script>

<style scoped>
#Laucher {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
</style>